import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter);

//定义路由组件，一个路径展示单个组件用component，展示多个组件用components
const routes = [
    {
        path: '/',
        name: 'myHome',
        component: () => import('../views/myHome.vue')
    },
    {
        path: '/myAbout',
        name: 'myAbout',
        component: () => import('../views/myAbout.vue')
    },
]

//创建路由实例并传递routes的配置
const router = new VueRouter({
    mode: 'hash',
    routes
});

//导出路由
export default router